package com.hello.system.service.impl;

import java.util.List;
import com.hello.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.hello.system.mapper.CommentRepliesMapper;
import com.hello.system.domain.CommentReplies;
import com.hello.system.service.ICommentRepliesService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;

/**
 * 评论回复Service业务层处理
 * 
 * @author hello
 * @date 2025-10-29
 */
@Slf4j
@Service
@RequiredArgsConstructor
public class CommentRepliesServiceImpl extends ServiceImpl<CommentRepliesMapper, CommentReplies> implements ICommentRepliesService 
{
    private final CommentRepliesMapper commentRepliesMapper;

    /**
     * 查询评论回复
     * 
     * @param replyId 评论回复主键
     * @return 评论回复
     */
    @Override
    public CommentReplies selectCommentRepliesByReplyId(Long replyId)
    {
        return commentRepliesMapper.selectCommentRepliesByReplyId(replyId);
    }

    /**
     * 查询评论回复列表
     * 
     * @param commentReplies 评论回复
     * @return 评论回复
     */
    @Override
    public List<CommentReplies> selectCommentRepliesList(CommentReplies commentReplies)
    {
        return commentRepliesMapper.selectCommentRepliesList(commentReplies);
    }

    /**
     * 新增评论回复
     * 
     * @param commentReplies 评论回复
     * @return 结果
     */
    @Override
    public int insertCommentReplies(CommentReplies commentReplies)
    {
        commentReplies.setCreateTime(DateUtils.getNowDate());
        return commentRepliesMapper.insertCommentReplies(commentReplies);
    }

    /**
     * 修改评论回复
     * 
     * @param commentReplies 评论回复
     * @return 结果
     */
    @Override
    public int updateCommentReplies(CommentReplies commentReplies)
    {
        commentReplies.setUpdateTime(DateUtils.getNowDate());
        return commentRepliesMapper.updateCommentReplies(commentReplies);
    }


    /**
     * 批量删除评论回复
     * 
     * @param replyIds 需要删除的评论回复主键
     * @return 结果
     */
    @Override
    public int deleteCommentRepliesByReplyIds(Long[] replyIds)
    {
        return commentRepliesMapper.deleteCommentRepliesByReplyIds(replyIds);
    }

    /**
     * 删除评论回复信息
     * 
     * @param replyId 评论回复主键
     * @return 结果
     */
    @Override
    public int deleteCommentRepliesByReplyId(Long replyId)
    {
        return commentRepliesMapper.deleteCommentRepliesByReplyId(replyId);
    }
}
